<?php
include("utils.php");
$mode = $_POST['mode'];
if($mode == 'UserRegistration')
{                                
editRegistration();
}
else
{
main_content("main();");
//main();
}

############################## function to update user account starts#########################
function editRegistration(){
//print_r($_REQUEST);
 $sql_update_account="update ".SITEUSER." set username = '".$_REQUEST['UserName']."', password = '".$_REQUEST['PassWord']."', fName = '".$_REQUEST['FirstName']."', lName = '".$_REQUEST['LastName']."', email = '".$_REQUEST['EmaiL']."', phone = '".$_REQUEST['MOBIle']."', company = '".$_REQUEST['CompName']."' where siteuserId = '".$_SESSION['siteuserId']."'";

$exe_update_account=mysql_query($sql_update_account);
if($exe_update_account)
{
	$GLOBALS['regmsg']="Account Information Updated Successfully";
}
else
{
	$GLOBALS['regmsg']="Failed To Update Account Information";
}
main_content("main();");
}
############################## function to update user account ends ############################

function main()
{
$select_edit_account="select * from ".SITEUSER." where siteuserId = '".$_SESSION['siteuserId']."'";
$exe_edit_account=mysql_query($select_edit_account);
$row_edit_account=mysql_fetch_array($exe_edit_account);

$sql_status_advertiser="select siteuserId from ".ADVERTISEMASTER." where siteuserId = '".$_SESSION['siteuserId']."'";
$exe_status_advertiser=mysql_query($sql_status_advertiser);
$num_status_advertiser=mysql_num_rows($exe_status_advertiser);

$sql_status_publisher="select UserId from ".ADSPSCEMASTER." where UserId = '".$_SESSION['siteuserId']."'";
$exe_status_publisher=mysql_query($sql_status_publisher);
$num_status_publisher=mysql_num_rows($exe_status_publisher);

?> 
<script language="javascript" src="JavaScripts/registration.js"></script>
<link href="css/global.css" rel="stylesheet" type="text/css">
<!--<link rel="stylesheet" href="css/style.css" type="text/css" />-->
<form id="myAccountForm" name="myAccountForm" method="post" action="" onsubmit="return regformvalidation();">

<input type="hidden" name="mode" value="UserRegistration" />
<table width="100%" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td valign="top" align="center"><table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
                  <tr>
                    <td width="20%" valign="top"><?php include("left_pannel.php"); ?></td>
                    <td valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
                      <tr>
                        <td valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
                            <tr>
                              <td width="11"><img src="images/PinkBorderTopLeft.jpg" alt="" width="11" height="11"></td>
                              <td class="PinkBoxTopBg"><img src="images/spacer.gif" alt="" width="10" height="11"></td>
                              <td width="11"><img src="images/PinkBorderTopRight.jpg" alt="" width="11" height="11"></td>
                            </tr>
                        </table></td>
                      </tr>
                      <tr>
                        <td class="PinkTwosideBorder" valign="top">rohit...................</td>
                      </tr>
                      <tr>
                        <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
                            <tr>
                              <td width="11"><img src="images/PinkBorderBottomLeft.jpg" alt="" width="11" height="11"></td>
                              <td class="PinkBoxBottomBg"><img src="images/spacer.gif" alt="" width="10" height="11"></td>
                              <td width="11"><img src="images/PinkBorderBottomRight.jpg" alt="" width="11" height="11"></td>
                            </tr>
                        </table></td>
                      </tr>
                    </table></td>
                    <td width="20%">&nbsp;</td>
                    </tr>
                </table></td>
              </tr>
            </table>
</form>
            
<?php
        //include("footer.php");
}
		?> 